var selectedTraderValue;
var selectedTrader;
function printFirstChallan(){
	
	if (!window.print){
		alert("Sorry unable to print the page");
		return
	}
	var selectableTrader=document.getElementById("showTraderMode");
		
	document.getElementById("selectTraders").innerHTML = "";
	document.getElementById("buttonsHide").innerHTML = "";
	document.getElementById("headerHide").innerHTML = "";
	
	if(selectableTrader==null || selectableTrader=="Select Traders"){
		window.print();
		document.getElementById("buttonShow").innerHTML='<div id="buttonsHide" class="divclear"><span class="buttonSiyora button80"><input type="submit" onclick="submitSelectedRecords();" value="Submit" /></span><span class="buttonSiyora button80" onclick="printFirstChallan();"><a>Print</a> </span><span class="buttonSiyora button80"><a href="/transport/pages/jsp/welcome.jsp" >Home </a> </span></div>';
		
	}
	else{
		selectedTrader = selectableTrader.options[selectableTrader.selectedIndex].text;
		selectedTraderValue = selectableTrader.options[selectableTrader.selectedIndex].value;
		document.getElementById("showTraders").innerHTML = selectedTrader;
		window.print();
	}
	
}

function AfterPrint(){
	document.getElementById("buttonShow").innerHTML='<div id="buttonsHide" class="divclear"><span class="buttonSiyora button80"><input type="submit" onclick="submitSelectedRecords();" value="Submit" /></span><span class="buttonSiyora button80" onclick="printFirstChallan();"><a>Print</a> </span><span class="buttonSiyora button80"><a href="/transport/pages/jsp/welcome.jsp" >Home </a> </span></div>';
	document.getElementById("hiddenTraders").innerHTML='<input type="hidden" name="trader" value="'+selectedTraderValue+'">';
}

function AfterSecondPrint(){
	document.getElementById("buttonShow").innerHTML='<div id="buttonsHide" class="divclear"><span class="buttonSiyora button80"><input type="submit" onclick="getSlipNo();" value="Submit" /></span><span class="buttonSiyora button80" onclick="printFirstChallan();"><a>Print</a> </span><span class="buttonSiyora button80"><a href="/transport/pages/jsp/welcome.jsp" >Home </a> </span></div>';
}

function AfterThirdPrint(){
	document.getElementById("buttonShow").innerHTML='<div id="buttonsHide" class="divclear"><span class="buttonSiyora button80"><input type="submit" onclick="saveForm();" value="Submit" /></span><span class="buttonSiyora button80" onclick="printFirstChallan();"><a>Print</a> </span><span class="buttonSiyora button80"><a href="/transport/pages/jsp/welcome.jsp" >Home </a> </span></div>';
}


function printSecondChallan(){
	if (!window.print){
		alert("Sorry unable to print the page");
		return
	}
	document.getElementById("buttonsHide").innerHTML = "";
	document.getElementById("headerHide").innerHTML = "";
	window.print();
}